#ifndef DBTABLEMANAGER_H
#define DBTABLEMANAGER_H

#include <QObject>
#include <QSharedPointer>

#include "abstractstruct.h"
#include "abstracttable.h"

#include "dataoperate.h"

typedef bool(*FnTableOperate)(const QString &, const QVariant &, QVariant &);

class DBTableManager : public QObject
{
public:
    DBTableManager(QObject *parent = nullptr);
    ~DBTableManager();

    void InitAllTable(const QString &connectionName);
//    void RegisterOperateFunc(AbstractStruct::StructType type, AbstractTable* table, FnTableOperate FnOperate);

    bool DataBaseOperate(DataOperate &DataOpera);

private:
    QHash<DataOperate::OperateFunc , FnTableOperate>       m_TableFuncHash;

    QString                                                m_ConnectName;
};

#endif // DBTABLEMANAGER_H
